from utils.core import log, CoreCaller
from utils import saveJson
import json

remote_db_config = {
    'user': 'root',
    'password': 'Niezl123',
    'host': '127.0.0.1',
    'database': 'poa_news',
    'raise_on_warnings': True
}

if __name__ == "__main__":
    core_caller = CoreCaller(remote_db_config)
    log.logger.info("Service begin...")

    result = core_caller.search_tag("iPhone")
    jsonResult = json.dumps(dict(result))
    saveJson(jsonResult, "iPhone.json")
